/*
 * Copyright (c) 2024 iSOFT INFRASTRUCTURE SOFTWARE CO., LTD.
 * easyAda is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */


#ifndef __CONFIG_H__
#define __CONFIG_H__

#define KB *(1024)
#define MB *(1024 KB)

#define CONFIG_DEBUG
#define CONFIG_WITH_FPU

#define CONFIG_ARCH_AARCH64

#define CONFIG_PAGE_SHIFT (12)
#define CONFIG_PAGE_SIZE  (1 << CONFIG_PAGE_SHIFT)

#define SLAB_MNGPGS    1
#define SLAB_MAX_SLICE (CONFIG_PAGE_SIZE >> 1)

#define CONFIG_STACK_PAGES (2)
#define CONFIG_STACK_SIZE  (CONFIG_STACK_PAGES << CONFIG_PAGE_SHIFT)

#define CONFIG_ENABLE_DPRINTF
#define CONFIG_DPRINTF_BUFSIZE (1024)

#define CONFIG_MAX_PRIORITY (64)

#define CONFIG_TIMER_TICK_US    (5000)
#define CONFIG_DEFUALT_TIMESLICE   (20000) // us
#define CONFIG_DEFAULT_PRIORITY    (10)
#define CONFIG_PRIORITY_ROOTSERVER (8)

#define CONFIG_SMP_CORES (4)

#if CONFIG_SMP_CORES > 1
#define CONFIG_ENABLE_SMP
#define CONFIG_MULTICORE_MAX_READY_TASK_COUNT 50
#endif

#define CONFIG_DOM_NUMBER        1
#define CONFIG_START_DOMAIN      0
#define CONFIG_BALANCE_THRESHOLD (0.2)

#define CONFIG_INITIAL_CNODE_RADIX (8)
#define CONFIG_INITIAL_CNODE_COUNT (1 << CONFIG_INITIAL_CNODE_RADIX)
#define CONFIG_THREAD_CNODE_RADIX  (5)
#define CONFIG_THREAD_CNODE_COUNT  (1 << CONFIG_THREAD_CNODE_RADIX)

#define CONFIG_MAX_SECS       2
#define CONFIG_PAGE_MAX_INDEX 15
#define CONFIG_PAGE_MAX       (1 << CONFIG_PAGE_MAX_INDEX)
#define CONFIG_BUDDY_MAX_LEN  (1 << 12)

#define CONFIG_ROOTSERVER_EXEC_ADDR (0X60000000)
#define CONFIG_ROOTSERVER_RDEV_ADDR (0X50000000)
#define CONFIG_SLAB_IGNORE          (6)

#define CONFIG_IRQ_COUNT 275

#define MMU_ENABLE
#define JUMP_EL0

#define CONFIG_NEW_TIME


#ifdef MMU_ENABLE

#define LINK_CONFIG_KERNEL_VBASE      (0xFFFF000080000000)
#define CONFIG_KERNEL_VBASE           (0xFFFF000080000000UL)
#define CONFIG_KERNEL_PBASE           (0x41000000)
#define CONFIG_KERNEL_SIZE            (0x01000000)
#define CONFIG_RS_PBASE               (CONFIG_KERNEL_PBASE + CONFIG_KERNEL_SIZE)
#define CONFIG_RS_VBASE               (0X60000000)
#define CONFIG_RS_SIZE                (0x01000000)
#define CONFIG_KHEAP_PBASE            (CONFIG_RS_PBASE + CONFIG_RS_SIZE)
#define CONFIG_KHEAP_VBASE            (0xFFFF000090000000)
#define CONFIG_KHEAP_SIZE             (128 MB)
#define CONFIG_KDEV_ADDR              (0xFFFF000010000000UL)
#define CONFIG_IDLESTACK_ADDR         (0x70000000)
#define CONFIG_IDLE_EXEC_ADDR         (CONFIG_IDLESTACK_ADDR - CONFIG_STACK_SIZE * CONFIG_SMP_CORES)
#define CONFIG_PAGE_TABLE_VBASE       (0xFFFF000070000000)
#define CONFIG_PAGE_TABLE_PBASE       (CONFIG_KHEAP_PBASE + CONFIG_KHEAP_SIZE)
#define CONFIG_PAGE_TABLE_RAM_SIZE    (128 MB)
#define CONFIG_UHEAP_PBASE            (CONFIG_PAGE_TABLE_PBASE + CONFIG_PAGE_TABLE_RAM_SIZE)
#define CONFIG_UHEAP_VBASE            (0x80000000)
#define CONFIG_UHEAP_SIZE             (128 MB)
#else
#define CONFIG_KERNEL_PBASE      (0x40000000UL)
#define LINK_CONFIG_KERNEL_VBASE (0x80000000)
#define CONFIG_KERNEL_VBASE      (0x80000000)

#define CONFIG_PAGE_TABLE_RAM_SIZE (128 MB)

#endif



#endif
